package com.woniu.mapper;

import com.baomidou.mybatisplus.core.metadata.IPage;
import com.woniu.pojo.Magnet;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.woniu.vo.MagnetQueryVo;
import com.woniu.vo.MagnetReturnVo;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

/**
 * <p>
 *  Mapper 接口
 * </p>
 *
 * @author long
 * @since 2022-10-12
 */
public interface MagnetMapper extends BaseMapper<Magnet> {
    @Select("select m.* , s.name, s.status, r.name from t_magnet m, t_space s, t_road r "+
            " where m.space_id = s.id and s.road_id = r.id and m.id = #{id}"
    )
    Magnet getSpaceById(long id);

    IPage<MagnetReturnVo> searchPageByMagnet(IPage iPage, @Param("magnetQueryVo") MagnetQueryVo magnetQueryVo);

}
